/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package util;

/**
 *
 * @author antonio
 */
public class CubixQueryFactory {

    private String graphUri;
    private String subUri;

    public CubixQueryFactory(String graphUri, String subUri)
    {
        this.graphUri = graphUri;
        this.subUri = subUri;
    }

    public String createQuery(int level)
    {
        String query = "";

            switch(level)
            {
                case 2:

                    query = "select ?persone ?nome ?status from <" + this.graphUri + "> where " +
                    "{?persone <http://unime.it/cubixprop#nelBlocco> \"" + this.subUri + "\" ." +
                            "?persone <http://unime.it/cubixprop#Nome> ?nome ." +
                            "?persone <http://unime.it/cubixprop#Status> ?status}";
                    break;

                case 1:

                    query = "select ?persone ?nome ?status from <" + this.graphUri + "> where " +
                    "{?persone <http://unime.it/cubixprop#nelPiano> \"" + this.subUri + "\" ." +
                            "?persone <http://unime.it/cubixprop#Nome> ?nome ." +
                            "?persone <http://unime.it/cubixprop#Status> ?status}";
                    break;

                case 0:

                    query = "select ?persone ?nome ?status from <" + this.graphUri + "> where " +
                    "{?persone <http://unime.it/cubixprop#nelAula> \"" + this.subUri + "\" ." +
                            "?persone <http://unime.it/cubixprop#Nome> ?nome ." +
                            "?persone <http://unime.it/cubixprop#Status> ?status}";
                    break;

            }
            
            return query;
    }

}
